<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>管理员登录</title>

<link rel="stylesheet" href="../../bootstrap/css/bootstrap.min.css">
<script type="text/javascript" src="../../js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../js/bootbox.min.js"></script>
</head>
<body>
	<div class=" container">
		<div class=" panel panel-warning ">
			<div class="panel-heading">
				<h3 class="panel-title">管理员登录</h3>
			</div>
			<div class="panel-body">
				<form id="defaultForm" class="form-horizontal">
					<div class="form-group has-warning">
						<label class="col-sm-2 control-label">用户名</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="username"
								placeholder="用户名" autofocus required>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">密码</label>
						<div class="col-sm-10">
							<input type="password" class="form-control" name="password"
								placeholder="密码" required>
						</div>
					</div>
					<div class="form-group">
						<button id="btnLogin" class="btn btn-info btn-block" type="submit">登录</button>
					</div>
				</form>
			</div>
		</div>
	</div>
F
	<script type="text/javascript">
		$(function() {
			$("#defaultForm").submit(function() {
				var username = $("input[name=username]").val();
				var password = $("input[name=password]").val();
				var user = {
					username : username,
					password : password
				};
				$.ajax({
					url : "../../admin/"+username+"/"+password,
					type : "GET"
				}).done(function(result) {
					if (result == 'success') {
						window.location.href = "adminmain.html?username="+username+"";
					} else {
						bootbox.alert(result);
					}
				});
				return false;
			});
		});
	</script>
</body>
</html>